package com.only4play.order.commons.model;


import com.only4play.order.commons.constants.BizEnum;
import com.only4play.order.commons.filters.selector.FilterSelector;
import lombok.Data;

import java.time.LocalDateTime;

/**
 * @author gim
 */
@Data
public abstract class AbstractOrderContext implements OrderContext{

  /**
   * 处理开始时间
   */
  private LocalDateTime startTime;

  /**
   * 处理结束时间
   */
  private LocalDateTime endTime;

  /**
   * 获取数据名称
   */
  public String getName() {
    return this.getClass().getSimpleName();
  }

  private final BizEnum bizEnum;
  private final FilterSelector selector;

  public AbstractOrderContext(BizEnum bizEnum, FilterSelector selector) {
    this.bizEnum = bizEnum;
    this.selector = selector;
  }

  @Override
  public BizEnum getBizCode() {
    return bizEnum;
  }

  @Override
  public FilterSelector getFilterSelector() {
    return selector;
  }
}
